package com.ruoyi.web.ydz.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.ydz.domain.InvitationLabel;
import com.ruoyi.web.ydz.mapper.InvitationLabelMapper;
import com.ruoyi.web.ydz.service.IInvitationLabelService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 帖子标签Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class InvitationLabelServiceImpl implements IInvitationLabelService
{
    @Resource
    private InvitationLabelMapper invitationLabelMapper;

    /**
     * 查询帖子标签
     * 
     * @param id 帖子标签主键
     * @return 帖子标签
     */
    @Override
    public InvitationLabel selectInvitationLabelById(Long id)
    {
        return invitationLabelMapper.selectInvitationLabelById(id);
    }

    /**
     * 查询帖子标签列表
     * 
     * @param invitationLabel 帖子标签
     * @return 帖子标签
     */
    @Override
    public List<InvitationLabel> selectInvitationLabelList(InvitationLabel invitationLabel)
    {
        return invitationLabelMapper.selectInvitationLabelList(invitationLabel);
    }

    /**
     * 新增帖子标签
     * 
     * @param invitationLabel 帖子标签
     * @return 结果
     */
    @Override
    public int insertInvitationLabel(InvitationLabel invitationLabel)
    {
        invitationLabel.setCreateTime(DateUtils.getNowDate());
        return invitationLabelMapper.insertInvitationLabel(invitationLabel);
    }

    /**
     * 修改帖子标签
     * 
     * @param invitationLabel 帖子标签
     * @return 结果
     */
    @Override
    public int updateInvitationLabel(InvitationLabel invitationLabel)
    {
        invitationLabel.setUpdateTime(DateUtils.getNowDate());
        return invitationLabelMapper.updateInvitationLabel(invitationLabel);
    }

    /**
     * 批量删除帖子标签
     * 
     * @param ids 需要删除的帖子标签主键
     * @return 结果
     */
    @Override
    public int deleteInvitationLabelByIds(Long[] ids)
    {
        return invitationLabelMapper.deleteInvitationLabelByIds(ids);
    }

    /**
     * 删除帖子标签信息
     * 
     * @param id 帖子标签主键
     * @return 结果
     */
    @Override
    public int deleteInvitationLabelById(Long id)
    {
        return invitationLabelMapper.deleteInvitationLabelById(id);
    }
}
